package PTA_JAVA.Exception6.demo1;

import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[5];
        while(sc.hasNext()){
            String s=sc.next();
            switch(s){
                case "arr":
                    try{
                        int a=arr[Integer.parseInt(sc.next())];
                    }catch(Exception e){
                        System.out.println(e);
                    }
                    break;
                case "null":
                    try{
                        Integer a = null;
                        a.toString();
                    }catch(Exception e){
                        System.out.println(e);
                    }
                    break;
                case "cast":
                    try{
                        Object str = new String("cast");
                        System.out.println((Integer)(str));
                    }catch(Exception e){
                        System.out.println(e);
                    }
                    break;
                case "num":
                    try{
                        Integer a=Integer.parseInt(sc.next());
                    }catch(Exception e){
                        System.out.println(e);
                    }
                    break;
                default:return;
            }
        }
    }
}
